package com.example.demo.controller2;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2024-02-26
 * Time: 20:32
 */
@RestController
@Slf4j
public class LoggerController {
    //定义日志对象
    //private static Logger logger = LoggerFactory.getLogger(LoggerController.class);//该参数表示由谁打印
    @PostConstruct//初始化方法
    public void print(){
        System.out.println("打印日志");
        log.info("dada");//日志内容
    }
}
